package com.hebeu.gfh.service.impl;

import com.hebeu.gfh.mapper.ClubsMapper;
import com.hebeu.gfh.mapper.UserMapper;
import com.hebeu.gfh.mapper.taskMapper;
import com.hebeu.gfh.pojo.po.Task;
import com.hebeu.gfh.pojo.vo.publishedTask;
import com.hebeu.gfh.service.taskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 刘剑利
 * @Version: v1.0
 */
@Service("taskService")
public class taskServiceImpl implements taskService {
    @Autowired
    taskMapper taskMapper;
    @Autowired
    ClubsMapper clubsMapper;
    @Autowired
    UserMapper userMapper;
    @Override
    public void publishTask(Task task) {
        taskMapper.publishTask(task);
    }

    @Override
    public List<Task> getTaskByuserId(int userId) {
        List<Task> taskList =taskMapper.getTaskByuserId(userId);
        return taskList;
    }

    @Override
    public List<publishedTask> getpublishedTask(int userId) {
        List<publishedTask> publishedTasks =taskMapper.getpublishedTask(userId);
        return publishedTasks;
    }

    @Override
    public void deleteTask(int taskId) {
        taskMapper.deleteTask(taskId);
    }
}
